﻿<local:DocumentBase x:Class="WPFExcelReport.MVTEKVKVRRMB"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
         Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <StackPanel >
            <WrapPanel >
                <Label Content="PI#："    Width="38" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtPI" Width="157" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="3"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Beige" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="发票号："    Width="67" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtINVOICE" Width="114" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="0"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Pink" MaxLength="8" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="发票状态："    Width="85" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <CheckBox Content="已付款" Height="16" Name="cbSTATUS" Background="WhiteSmoke" />
            </WrapPanel>
            <WrapPanel >
                <Label Content="客户简称："    Width="84" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtKUNDNR" Width="87" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="5"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="10" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="下单日期从" Height="26" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label3" VerticalAlignment="Top" Width="93" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="118" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label4" VerticalAlignment="Top" Width="19" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="118" />
                <Button Content="查询数据" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="73" Panel.ZIndex="8"
                        Click="btnQuery_Click"/>
                <Button Content="导出EXCEL" Height="33" Margin="10,0,0,0"  Name="btnEXCEL" Width="73" Panel.ZIndex="9"
                        Click="btnEXCEL_Click"/>
            </WrapPanel>
        </StackPanel> 
        <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.Row="1" DataContext="{Binding}">
            <!--EKPNEUD	VRPRENR	VVTLIEFSCH	VKPAUFKRS	VKPAUFLFD	VKPAUFPOS	EKPAUFPOS	
                    VKPNEUBEN	PI	VKPWAEHRSL	KDKUNDNA	VKPART	VKPFARBE	ORDQTY	VKPMEEH	ORDMTR	RATE	
                    SOPRICE	SOMTRPRICE	POPRICE	POMTRPRICE	QDMTRPRICE	DELQTY	INVQTY	VRKKOMPL	
                    POSUR	SOSUR COMMISSION,D.VEVERTNA	PROFITS-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=EKPNEUD}" Header="下单日期" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=VRPRENR}" Header="发票号" Width="SizeToCells" MinWidth="50" />
                <DataGridTextColumn Binding="{Binding Path=VRKKOMPL}" Header="发票状态" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VVTLIEFSCH}" Header="发货单号" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="开单人" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=PI}" Header="PI#" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="订单行" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=KDKUNDNA}" Header="客户简称" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VEVERTNA}" Header="代理简称" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPWAEHRSL}" Header="货币" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="品种" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="颜色" Width="SizeToCells" MinWidth="50" />
                <DataGridTextColumn Binding="{Binding Path=ORDQTY}" Header="订单量" Width="SizeToCells" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="单位" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=ORDMTR}" Header="订单米数" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=SOPRICE}" Header="销售价格" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=SOMTRPRICE}" Header="销售价格M" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=POPRICE}" Header="工厂价格" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=POMTRPRICE}" Header="工厂价格M" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=RATE}" Header="系数" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=QDMTRPRICE}" Header="青岛价格M" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=DELQTY}" Header="发货数量M" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=POSUR}" Header="工厂附加费" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=SOSUR}" Header="销售附加费" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=COMMISSION}" Header="代理佣金" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=PROFITS}" Header="利润" Width="SizeToCells" MinWidth="40" />
                <!--DataGridTextColumn Binding="{Binding Path=DD}" Header="剩余天数" Width="SizeToCells" MinWidth="40" /-->

            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</local:DocumentBase>
